﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace University.Workshop.Presenters.OtbData.Read
{
    public class PresenterReadSecondStep
    {
        ISecondStepForRead view;
        public PresenterReadSecondStep(ISecondStepForRead view)
        {
            this.view = view;
        }

        public void UpdateViewData()
        {
            view.PersonId = view.OtbDataToRead.Person.PersonId;
            view.PersonNames = view.OtbDataToRead.Person.Names;
            view.PersonLastNames = view.OtbDataToRead.Person.LastNames;
            ChargePhonesToList();
        }

        public void ChargePhonesToList()
        {
            view.PersonPhones = view.OtbDataToRead.Person.Phone.Split(',').ToList().Where(x=>x!=string.Empty).ToList();
        }

    }
}
